package tp1.datos;

import java.sql.Connection;
import java.sql.DriverManager;

public class Conexion {
	//Para probar parte de Provincias
	//String db = "pruevamvc";
	
	String db = "tp1_java_web";
	String user = "root";
	String pass = "root";
	String driver = "com.mysql.jdbc.Driver";
	String url = "jdbc:mysql://localhost/"+db;
	Connection conn = null;
	
	public Conexion() {
		try {
			Class.forName(driver);
			conn = DriverManager.getConnection(url,user,pass);
		} catch(Exception ex) {
			ex.printStackTrace();
		}
	}
	
	public Connection getConexion() {
		return conn;
	}
	
	public boolean verificar() {
		if (this.conn==null)
			return false;
		else
			return true;
	}
}